namespace DotNetDalTest.AbstractEntities
{
    using System;
    using System.Collections.Generic;
    using System.Data.SqlClient;
    using DotNetDal.Core;
    using DotNetDal.Core.Data;
    using DotNetDal.Core.StructureAttributes;


    [TableAttribute(Schema = "Person")]
    public partial class AbstractContact : DALTable
    {

        private static Entities.Contact instance = new Entities.Contact();

        [FieldAttribute(IsPrimaryKey = true)]
        public int ContactID
        {
            get
            {
                return ((int)(this["ContactID"]));
            }
            set
            {
                this["ContactID"] = value;
            }
        }

        [FieldAttribute()]
        public bool NameStyle
        {
            get
            {
                return ((bool)(this["NameStyle"]));
            }
            set
            {
                this["NameStyle"] = value;
            }
        }

        [FieldAttribute(IsNullable = true)]
        public string Title
        {
            get
            {
                return ((string)(this["Title"]));
            }
            set
            {
                this["Title"] = value;
            }
        }

        [FieldAttribute()]
        public string FirstName
        {
            get
            {
                return ((string)(this["FirstName"]));
            }
            set
            {
                this["FirstName"] = value;
            }
        }

        [FieldAttribute(IsNullable = true)]
        public string MiddleName
        {
            get
            {
                return ((string)(this["MiddleName"]));
            }
            set
            {
                this["MiddleName"] = value;
            }
        }

        [FieldAttribute()]
        public string LastName
        {
            get
            {
                return ((string)(this["LastName"]));
            }
            set
            {
                this["LastName"] = value;
            }
        }

        [FieldAttribute(IsNullable = true)]
        public string Suffix
        {
            get
            {
                return ((string)(this["Suffix"]));
            }
            set
            {
                this["Suffix"] = value;
            }
        }

        [FieldAttribute(IsNullable = true)]
        public string EmailAddress
        {
            get
            {
                return ((string)(this["EmailAddress"]));
            }
            set
            {
                this["EmailAddress"] = value;
            }
        }

        [FieldAttribute()]
        public int EmailPromotion
        {
            get
            {
                return ((int)(this["EmailPromotion"]));
            }
            set
            {
                this["EmailPromotion"] = value;
            }
        }

        [FieldAttribute(IsNullable = true)]
        public string Phone
        {
            get
            {
                return ((string)(this["Phone"]));
            }
            set
            {
                this["Phone"] = value;
            }
        }

        [FieldAttribute()]
        public string PasswordHash
        {
            get
            {
                return ((string)(this["PasswordHash"]));
            }
            set
            {
                this["PasswordHash"] = value;
            }
        }

        [FieldAttribute()]
        public string PasswordSalt
        {
            get
            {
                return ((string)(this["PasswordSalt"]));
            }
            set
            {
                this["PasswordSalt"] = value;
            }
        }

        [FieldAttribute()]
        public System.Guid rowguid
        {
            get
            {
                return ((System.Guid)(this["rowguid"]));
            }
            set
            {
                this["rowguid"] = value;
            }
        }

        [FieldAttribute()]
        public System.DateTime ModifiedDate
        {
            get
            {
                return ((System.DateTime)(this["ModifiedDate"]));
            }
            set
            {
                this["ModifiedDate"] = value;
            }
        }

        public static Entities.Contact[] GetFromSql(string sql)
        {
            return DALRecord.GetFromSql<Entities.Contact>(sql);
        }

        public static Entities.Contact[] GetFromSql(string sql, params SqlParameter[] sqlParams)
        {
            return DALRecord.GetFromSql<Entities.Contact>(sql, sqlParams);
        }
    }
}
